#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

#define in read()
#define pii pair<int,int>
#define fi first
#define se second
#define mes(x) memset(x,0,sizeof(x))
#define FILE(x) freopen(x".in","r",stdin);\
	freopen(x".out","w",stdout)

int read(){
	int x = 0,sgn = 1;char ch = getchar();
	for(;!isdigit(ch);ch = getchar()) if(ch == '-') sgn = -1;
	for(;isdigit(ch);ch = getchar()) x = (x<<1)+(x<<3)+(ch^48);
	return x*sgn;
}

const int MAXN = 2010;
const int MAXQ = 2e5+10;
const int mod = 1e9+7;

ll f[MAXN],fac[MAXQ],inv[MAXQ];
int h,w,n,x,y;
pii node[MAXN];

ll qp(ll x,int t){ll res = 1;for(;t;t>>=1,x=x*x%mod)if(t&1)res = res * x % mod;return res;}

ll C(int x,int y){if(x < 0 || y < 0 || x < y) return 0;return fac[x] * inv[x-y] % mod  * inv[y] % mod;}

ll plan(int x,int y){return C(x+y,x);}

int main (){
	h = in,w = in,n = in; for(int i = 1;i <= n;i++) x = in,y = in,node[i].fi = x,node[i].se = y;
	for(int i = (fac[0] = 1);i <= h+w;i++) fac[i] = fac[i-1] * i % mod; inv[h+w] = qp(fac[h+w],mod-2);
	for(int i = h + w-1;i >= 0;i--) inv[i] = inv[i+1] * (i + 1) % mod;
	node[0].fi = 1,node[0].se = 1;
	sort(node,node+n+1);
	for(int i = 0;i <= n;i++) f[i] = plan(h-node[i].fi,w-node[i].se);
	for(int i = n-1;i >= 0;i--)
		for(int j = i+1;j <= n;j++)
			if(node[i].fi <= node[j].fi && node[i].se <= node[j].se)
				f[i] = (f[i] - f[j] * plan(node[j].fi-node[i].fi,node[j].se-node[i].se) % mod+ mod) % mod;
	printf("%lld\n",f[0]);
	return 0;
}

